<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="">
    <meta name="author" content="">
	<link rel="shortcut icon" href="favicon.png">
    <title>文件上传</title>
<script type="text/javascript" src="${ctx}/scripts/appconfig.jsp" charset="utf-8" ></script>
<link href="${ctxStatic}/bootstrap/2.3.1/css_${not empty cookie.theme.value ? cookie.theme.value:'default'}/bootstrap.min.css" type="text/css" rel="stylesheet" />
  <link rel="stylesheet" href="${ctx}/static/jQuery-File-Upload-9.7.0/css/jquery.fileupload.css">
<link rel="stylesheet" href="${ctx}/static/jQuery-File-Upload-9.7.0/css/jquery.fileupload-ui.css">
<link rel="stylesheet" href="${ctx}/static/common/app_group.css">
<link href="${ctxStatic}/jquery-jbox/2.3/Skins/Bootstrap/jbox.css?a" rel="stylesheet" />
    <style>
	body{
  		padding-top: 10px;
		z-index: 10001;
	}
</style>
<script type="text/javascript">
//确认对话框
function confirmDelfile(){
	return false;
}

</script>
  </head>
  <body>
<div class="control-group" >
    <form style="margin-left:20px;" id="fileupload" action="${ctx}/attachment/filesUpload.do" method="POST" enctype="multipart/form-data" >
                    <input type="hidden" name="tableId" value="${fns:encodeParam(tableId)}">
                    <input type="hidden" name="partId" value="${fns:encodeParam(partId)}">
<%--                     <input type="hidden" name="fileTime" value="${fns:encodeParam(fileTime)}"> --%>
                    <input type="hidden" name="tableName" value="${fns:encodeParam(tableName)}">
                    <input type="hidden" name="tableField" value="${fns:encodeParam(tableField)}">
           <div class="fileupload-buttonbar" >
            <div class="col-lg-7">
                <!-- The fileinput-button span is used to style the file input field as button -->
                <span class="btn btn-success fileinput-button">
                	<span>选择文件</span>
                    <i class="glyphicon glyphicon-plus"></i>
                      <input type="file" name="files[]" multiple>
                </span>
                <button type="submit" class="btn btn-primary start">
                    <i class="glyphicon glyphicon-upload"></i>
                    <span>开始上传</span>
                </button>
              <span class="fileupload-process"></span>  
            </div>
            <!-- The global progress state -->
            <div class="col-lg-5 fileupload-progress fade">
                <!-- The global progress bar -->
                <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
                    <div class="progress-bar progress-bar-success" style="width:0%;"></div>
                </div>
                <!-- The extended global progress state -->
                <div class="progress-extended">&nbsp;</div>
            </div>
        </div>
        <table role="presentation" class="table table-striped">
        <tbody class="files"></tbody></table>
    </form>
    </div><!-- /container -->

<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-upload fade">
        <td>
            <p class="name">{%=file.name%}</p>
            <strong class="error text-danger"></strong>
        </td>
        <td colspan="4">
            {% if (!i && !o.options.autoUpload) { %}
                <button class="btn btn-primary start" disabled>
                    <i class="glyphicon glyphicon-upload"></i>
                    <span>上传</span>
                </button>
            {% } %}
         {% if (!i) { %}
                <button class="btn btn-warning cancel">
                    <i class="glyphicon glyphicon-ban-circle"></i>
                    <span>取消</span>
                </button>
            {% } %}
        </td>
    </tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-download fade">
        <td>
            <p class="name">
                {% if (file.urlPath) { %}
					<i class="i_group i_{%=file.fileIcon%}_h17"></i>
                    <a href="${ctx}/attachment/filedown.do?attId={%=file.id%}" target="_blank" title="{%=file.fileName%}" >{%=file.name%}</a>
                {% } else { %}
                    <span>{%=file.name%}</span>
                {% } %}
            </p>
            {% if (file.error) { %}
                <div><span class="label label-danger">Error</span> {%=file.error%}</div>
            {% } %}
        </td>
        <td>
            <span class="size">{%=file.uploadPerson%}</span>
        </td>
        <td>
            <span class="size">{%=file.createDate%}</span>
        </td>
        <td>
            <span class="size">{%=o.formatFileSize(file.size)%}</span>
        </td>
        <td>
            {% if (file.delPath) { %}
                <button class="btn btn-danger delete" data-type="POST" onclick="return confirmDelfile();" data-url="${ctx}{%=file.delPath%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
                    <i class="glyphicon glyphicon-trash"></i>
                    <span>删除</span>
                </button>
            {% } else { %}
 				 <button class="btn btn-warning cancel">
                    <i class="glyphicon glyphicon-ban-circle"></i>
                    <span>取消</span>
                </button>
            {% } %}
        </td>
    </tr>
{% } %}
</script>
<script src="${ctxStatic}/jquery/jquery-2.0.2.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/common/default.js?v=${fns:getJsVersion()}" type="text/javascript"></script>
<script src="${ctxStatic}/jquery-jbox/2.3/jquery.jBox-2.3.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/jquery-jbox/2.3/i18n/jquery.jBox-zh-CN.min.js" type="text/javascript"></script>
<script src="${ctx}/static/attachment/static/bootstrap/js/bootstrap.min.js"></script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script src="${ctx}/static/jQuery-File-Upload-9.7.0/js/vendor/jquery.ui.widget.js"></script>
<!-- The Templates plugin is included to render the upload/download listings -->
<script src="${ctx}/static/jQuery-File-Upload-9.7.0/js/tmpl.min.js"></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="${ctx}/static/jQuery-File-Upload-9.7.0/js/load-image.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="${ctx}/static/jQuery-File-Upload-9.7.0/js/canvas-to-blob.min.js"></script>
<!-- blueimp Gallery script -->
<script src="${ctx}/static/jQuery-File-Upload-9.7.0/js/jquery.blueimp-gallery.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="${ctx}/static/jQuery-File-Upload-9.7.0/js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="${ctx}/static/jQuery-File-Upload-9.7.0/js/jquery.fileupload.js"></script>
<!-- The File Upload processing plugin -->
<script src="${ctx}/static/attachment/static/jQuery-File-Upload-9.7.0/js/jquery.fileupload-process.js"></script>
<!-- The File Upload image preview & resize plugin -->
<script src="${ctx}/static/jQuery-File-Upload-9.7.0/js/jquery.fileupload-image.js"></script>
<!-- The File Upload audio preview plugin -->
<script src="${ctx}/static/jQuery-File-Upload-9.7.0/js/jquery.fileupload-audio.js"></script>
<!-- The File Upload video preview plugin -->
<script src="${ctx}/static/jQuery-File-Upload-9.7.0/js/jquery.fileupload-video.js"></script>
<!-- The File Upload validation plugin -->
<script src="${ctx}/static/jQuery-File-Upload-9.7.0/js/jquery.fileupload-validate.js"></script>
<!-- The File Upload user interface plugin -->
<script src="${ctx}/static/jQuery-File-Upload-9.7.0/js/jquery.fileupload-ui.js"></script>
<!-- The main application script -->
<script src="${ctx}/static/jQuery-File-Upload-9.7.0/js/main.js?de=33"></script>
<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 -->
<!--[if (gte IE 8)&(lt IE 10)]>
<script src="${ctx}/static/attachment/static/jQuery-File-Upload-9.7.0/js/cors/jquery.xdr-transport.js"></script>
<![endif]-->
  
  </body>
</html>

